const fs = require("fs");

/**
 * 流式读取能提升性能
 * 每次读取64kb字节量
 */

const rs = fs.createReadStream("../视频/141-VID_20220918_203052.mp4");
// const rs = fs.createReadStream("./流式写入.txt");

rs.on("data", (chunk) => {
  console.log(chunk.length); //65536
  console.log(chunk);
});

rs.on("end", () => {
  console.log("读取结束");
});
